/* 将输入的信息打印出来 */
var msg = ['userName', 'age', 'sex'];
var stdin = process.stdin;
var index = 0;
var infor = [];
console.log(msg[0] + ':');
//监听用户输入的过程
stdin.on("data", function (chunk) {
    var str = chunk.toString('utf-8');
    var result = str.slice(0, -2);
    infor[index] = result;
    index++;
    if (index == 3) {
        console.log(infor);
        process.exit();
    }
    console.log(msg[index] + '；');
})